package com.kaishengit.service;

import java.util.List;

import com.kaishengit.dao.ContactDao;
import com.kaishengit.entity.Contact;
import com.kaishengit.util.StringUtil;

public class ContactService {
	private ContactDao dao = new ContactDao();

	public void save(String name, String companyname, String mobile,
			String tel, String email, String address, String website,
			String weibo, String content, String projectid) {
		Contact contact = new Contact();
		contact.setId(StringUtil.getId());
		contact.setName(name);
		contact.setCompanyname(companyname);
		contact.setMobile(mobile);
		contact.setTel(tel);
		contact.setEmail(email);
		contact.setAddress(address);
		contact.setWebsite(website);
		contact.setWeibo(weibo);
		contact.setContent(content);
		contact.setProjectid(projectid);
		dao.save(contact);
		
	}

	public List<Contact> findByProjectid(String projectid) {
		
		return dao.findByProjectid(projectid);
	}

	public Contact findById(String cid) {
		
		return dao.findById(cid);
	}

	public void edit(String id, String name, String companyname, String mobile,
			String tel, String email, String address, String website,
			String weibo, String content) {
		dao.edit(id,name,companyname,mobile,tel,email,address,website,weibo,content);
		
	}

	public void del(String id) {
		dao.del(id);
		
	}

	
}
